£
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
     Dim strname$
     OpenFileDialog1.Filter = "ıļ*.txt)|*.txt|ͼļ*.bmp)|*.bmp"
     OpenFileDialog1.DefaultExt = "*.bmp"
     OpenFileDialog1.ShowDialog()
     strname = OpenFileDialog1.FileName
     TextBox1.Text = strname
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
     SaveFileDialog1.Filter = "ıļ*.txt)|*.txt|ͼļ*.bmp)|*.bmp"
     SaveFileDialog1.FileName = "c:\t.txt"
     SaveFileDialog1.ShowDialog()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
     FontDialog1.ShowColor = True
     FontDialog1.ShowDialog()
     TextBox1.Font = FontDialog1.Font
     TextBox1.ForeColor = FontDialog1.Color
End Sub
Private Sub Button4_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button4.Click
     ColorDialog1.AllowFullOpen = True
     ColorDialog1.ShowHelp = True
     ColorDialog1.Color = TextBox1.ForeColor
     ColorDialog1.ShowDialog()
     TextBox1.ForeColor = ColorDialog1.Color
End Sub
Private Sub Button5_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button5.Click
      FolderBrowserDialog1.ShowDialog()
      Dim ff As New FontDialog
      ff.ShowColor = True
      ff.ShowDialog()
      TextBox1.ForeColor = ff.Color
End Sub
Private WithEvents docToPrint As New Printing.PrintDocument
Private Sub Button6_Click(ByVal sender As System.Object, _
      ByVal e As System.EventArgs) Handles Button6.Click
      PrintDialog1.AllowSomePages = True
      PrintDialog1.ShowHelp = True
      PrintDialog1.Document = docToPrint
      If PrintDialog1.ShowDialog() = 1 Then
          docToPrint.Print()
      End If
End Sub
Private Sub document_PrintPage(ByVal sender As Object, _
       ByVal e As System.Drawing.Printing.PrintPageEventArgs) _
           Handles docToPrint.PrintPage
     Dim text As String = "In document_PrintPage method."
     Dim printFont As New System.Drawing.Font("Arial", 35, _ System.Drawing.FontStyle.Regular)
e.Graphics.DrawString(text, printFont, System.Drawing.Brushes.Black, _
 10, 10)
End Sub

